<%@page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ include file="/commons/commonList.jsp"%>
<script language="JavaScript" type="text/javascript"
	src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/ajaxException.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/rightmenu2.js"></script>
<%@ include file="/commons/validation.jsp"%>
<title></title>
<script type="text/javascript">
  var currentCustomerEventId="";
  var MAINACTION = "${ctx}/customerService_custServEventAction.do"; //客服事件ACTION

  function setCurrentCustomerEventId(id){
  	currentCustomerEventId=id;
  }

  function submitSearch(){ //提交查询
  	var flag = $("searchCustomerEvent").fireEvent("onsubmit");
  	if(!flag) return;

	var url = "${ctx}/customerService_custServEventAction.do?method=setCustomerEventSearchCondition";
	var params = $("searchCustomerEvent").serialize();
	sendAjaxRequest(url,params,refleshFrame);
  }

  function openGaoJiSearch(){ //打开高级查询页面
	var url = MAINACTION + "?method=initGaojiSearch"
	top.windowOpen(url,"gaojiSearch","高级查询",540,540,true,"gaojiSearchFrame");
  }

  function openCustomerEventAdd(){ //打开事件登记
	   var url =  MAINACTION + "?method=initCustomerEventAdd";
	   top.windowOpen(url, "customerEventAdd", "事件登记", 560, 650,true,"customerEventEditFrame");
  }

  function openCustomerEventEdit(){ //打开事件修改页面
    if(currentCustomerEventId == ""){
	   Alert('请选择一条记录后再修改!');
	   return false;
   }
 	var url = MAINACTION + "?method=validationIsAllowEventEdit" ;
 	var param = "eventId=" + currentCustomerEventId ;
	sendAjaxRequest(url,param,function(result){
		ajaxSubmitException(result.responseText);
	  	 var url = MAINACTION + "?method=initCustomerEventEdit&customerEventId="+currentCustomerEventId;
	   	 top.windowOpen(url, "customerEventEdit", "修改事件登记", 560, 650,true,"customerEventEditFrame");
	});
  }

  function openAsideCustEvent(){ //打开作废事件提示
    if(currentCustomerEventId == ""){
	   Alert('请选择一条记录!');
	   return false;
	}
   	var url = MAINACTION + "?method=validationIsAllowSetAsideEvent" ;
 	var param = "eventId=" + currentCustomerEventId ;
	sendAjaxRequest(url,param,function(result){
			ajaxSubmitException(result.responseText);
			AskConfirm("您确定作废该事件吗？","main","asideCustEvent");
	});
   }
   function openCustEventDetail(currID){ //打开事件详细页面
   	 var url = MAINACTION + "?method=initCustservEventDetailMain&custEventKeyword="+currID;
   	 top.windowOpen(url, "customerEventDetail", "详细资料", 480,950,true,"customerEventDetailFrame");
   }
   function asideCustEvent(){ //提交到作废事件页面
 		var url = MAINACTION + "?method=initAsideCustEvent&custEventKeyword="+currentCustomerEventId;
		top.windowOpen(url,"asideCustEvent","作废",230,400,true,"asideCustEventFrame");
   }

  /**
   * 打开客户任务主页面
   */
  function openCustomerEvent(){
  	var url = "${ctx}/customerService_deptCooperationAction.do?method=initCustomerTaskMain&customerEventId="+currentCustomerEventId;
  	top.windowOpen(url, "customerTask", "任务列表", 500, 950,true,"customerTaskFrame");
  }

  function openTaskSubmit(){ //打开事件提交页面

 	var url = "${ctx}/customerService_deptCooperationAction.do?method=validationAllowSubmit" ;
 	var param = "custServiceEventId=" + currentCustomerEventId ;
	sendAjaxRequest(url,param,function(result){
		ajaxSubmitException(result.responseText);
	  	var url = "${ctx}/customerService_deptCooperationAction.do?method=navigateTaskSubmit&keyword=" + currentCustomerEventId;
	  	top.windowOpen(url, "taskSubmit", "提交责任部门", 210, 450,true,"taskSubmitFrame");
  	});
  }

  function openReturnVisitRecord(){ //打开回访管理
  	var url = "${ctx}/customerService_returnVisitAction.do?method=initMain&customerServiceEventID=" + currentCustomerEventId;
  	top.windowOpen(url,"returnVisitRecord","回访管理",450,850,true,"returnVisitRecordFrame");
  }

  function openCheckRecord(){ //打开抽检登记
  	var url = "${ctx}/customerService_CheckRecordAction.do?method=initMain&customerServiceEventID=" + currentCustomerEventId;
  	top.windowOpen(url,"checkRecord","抽检登记",450,850,true,"checkRecordFrame");
  }
  function openSignReading(){//阅签
        if(currentCustomerEventId==""){
			Alert("请选择需要阅签的记录");
			return;
		}
 	var url = "${ctx}/customerService_signReadingAction.do?method=validationAllowSignReading" ;
 	var param = "custEventid=" + currentCustomerEventId ;
	sendAjaxRequest(url,param,function(result){
		ajaxSubmitException(result.responseText);
	  	var url = "${ctx}/customerService_signReadingAction.do?method=initMain&custEventid=" + currentCustomerEventId;
	  	top.windowOpen(url,"signReading","领导阅签",480,950,true,"signReadingFrame");
  	});
  }
  function openArchivism(){ //调用customerEventList.jsp的方法

     var iframeList=findFrame("customerEventList");
			iframeList.openArchivism();

  }
  function archivism(){ //归档
  		var url = MAINACTION + "?method=archivism&keyword=" + currentCustomerEventId;
		sendAjaxRequest(url,null,function(result){
			ajaxSubmitException(result.responseText);
			refleshFrame();
		});
  }
  function openLinkTheOther(){ //打开关联事件
	var url = MAINACTION  + "?method=initLinkTheOtherListMain&keyword=" + currentCustomerEventId;
	top.windowOpen(url,"linkTheOther","关联事件列表",450,900,true,"linkTheOtherFrame");
  }

  function openTrackRecord(){ //打开事件跟踪
 	var url = "${ctx}/customerService_trackRecordAction.do?method=initMain&customerServiceEventID=" + currentCustomerEventId;
	top.windowOpen(url,"trackRecord","事件跟踪",450,850,true,"trackRecordFrame");
  }

   //提示事件完工
  function openOver(){  // 调用customerEventList.jsp的方法
   var iframeList=findFrame("customerEventList");
			iframeList.openOver();
  }

  function complete(){//事件完工
 	var url = MAINACTION + "?method=manualTriggerComplete&eventId=" + currentCustomerEventId;
	sendAjaxRequest(url,null,function(result){
		ajaxSubmitException(result.responseText);
		refleshFrame();
	});
  }
  /**
   *  刷新列表页面
   */
  function refleshFrame(){
  currentCustomerEventId='';
  	var url = MAINACTION +"?method=queryCustomerEventList";
  	document.frames["customerEventList"].document.location.href = url;
  }
	/**
	 *打开派工单
	 */
  function openDispatchMain(){
  	 var url = "${ctx}/customerService_dispatchFormAction.do?method=dispatchFormCommonMain&customerEventId="+currentCustomerEventId;
	 top.windowOpen(url, "openDispatchMain", "派工单管理", 520, 950,true,"openDispatchMain");

  }

/***********页面私有方法**************/
function init(){
	initSelectValue("eventStatuz");
	initSelectValue("returnVisitStatuz");
	initSelectValue("reviewerStatuz");

	addUnderline("returnVisitStatuz");
	addUnderline("reviewerStatuz");
}
//为下拉框添加"-"
function addUnderline(selectId){
	var option = document.createElement("option");
	var text = document.createTextNode("--");
	option.value = "-";
	$(selectId).options.add(option,1);
	option.appendChild(text);
	$(selectId).selectedIndex = 0;
}
//修改事件状态 下拉框的value
function initSelectValue(selectId){
	var options = $(selectId).options;
	for(var i = 0; i < options.length; i++){
		if(options[i].code != "undefined" && options[i].code != null && options[i].code != "")
			options[i].value = options[i].code;
	}
}
</script>

</head>
<body style="overflow: auto;" onload="init();">

<div class="pageNav_bg">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
     <td width="50" id="pageNav_leftimg">
     	<img src="${ctx}/images/ico_custome_sq.gif" width="46" height="47"/>
     </td>
      <td id="navWord"><span class="page_title">客服事件</span></td>
      <td class="pageNav_right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      	<a href="javascript:showFull_in();">
      		<img id="full_image"  src="${ctx}/images/ico_fullscreen.gif" border="0"/>
      	</a>
    </tr>
  </table>
</div>

<div class="container">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td class="bg_search2">
	  <table border="0" cellpadding="0" cellspacing="1" id="search01">
	   <form action="${ctx}/customerService_custServEventAction.do?method=queryCustomerEventList"
	   		 id="searchCustomerEvent" name="searchCustomerEvent" method="post" target="customerEventList" class="required-validate">
        <tr>
        <td class="td_search">房 号：</td>
          <td class="td_search">
				<input id="houseNumber" name="houseNumber" type="text"
					   class="inputtext validate-char"
					   onkeydown="if(event.keyCode==13) submitSearch();"
	                	value="" size="16" maxlength="10"/>
          </td>
          <td height="30" class="grid align_left" >详细地点：</td>
          <td class="td_search">
				<input id="fullAddress" name="fullAddress" type="text" value="" size="16"  maxlength="100"
						onkeydown="if(event.keyCode==13) submitSearch();"
            		  class="inputtext validate-char" />
          </td>
          <td class="td_search">事件性质：</td>
          <td class="td_search">
   				<pms:unitedSelect name="eventNatureKeyword"
   								style="width:110px;"
   								dataList="${eventNature}"
   								optionLabel="name"
   								optionValue="keyword"
   								selectText="请选择...">
   				</pms:unitedSelect>
          </td>
          <td class="td_search">事件状态：</td>
          <td class="td_search">
            <mypms:Sysrefcode id="eventStatuz" name="eventStatuz" code="CUST_SERVICE_EVENT_EVENT_STATUZ"></mypms:Sysrefcode>

          </td>
          <td class="td_search">&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td class="grid align_left" >联系人：</td>
          <td class="td_search">
            	<input name="contact" type="text" class="inputtext validate-char" maxlength="36"
            			onkeydown="if(event.keyCode==13) submitSearch();"
            		   value="" size="16" />
          </td>
          <td height="23" class="grid align_left" >回访状态：</td>
          <td class="td_search">
          	<mypms:Sysrefcode id="returnVisitStatuz"
          					showTip="true"
          					name="returnVisitStatuz"
          					code="CUST_SERVICE_EVENT_RETURN_VISIT_STATUZ">
          	</mypms:Sysrefcode>
          </td>
          <td class="td_search">阅签状态：</td>
          <td class="td_search">
          	<mypms:Sysrefcode id="reviewerStatuz"
          					showTip="true"
          					name="reviewerStatuz"
          					code="CUST_SERVICE_EVENT_REVIEWER_STATUZ">
          	</mypms:Sysrefcode>
          </td>
          <td class="td_search">&nbsp;</td>
          <td class="td_search">&nbsp;</td>
          <td class="td_search">
		  <table border="0" cellpadding="0" cellspacing="0" >
            <tr>
              <td class="buttonOffLeft" id="btn1_11"></td>
              <td class="buttonOffMiddle" id="btn1_12" onblur="btn_change(1)"
              	onMouseOver="btn_change_over(1)" onMouseOut="btn_change_out(1)"
              	onclick="submitSearch()">
              	<img src="${ctx}/images/ico_searchico.gif" alt="" border="0" align="absmiddle" /> 查
                询</td>
              <td class="buttonOffRight" id="btn1_13"></td>
            </tr>
          </table></td>
          <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_21"></td>
              <td class="buttonOffMiddle" id="btn1_22" onblur="btn_change(2)"
              	onMouseOver="btn_change_over(2)" onMouseOut="btn_change_out(2)">
              		<a href="#" onFocus="this.blur()" onClick="openGaoJiSearch();"style="color:#000;">高级查询</a>
              </td>
              <td class="buttonOffRight" id="btn1_23"></td>
            </tr>
        </table></td>
        </tr>
        </form>
      </table>	  </td>
    </tr>
    <tr>
      <td class="bg_toolBar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>

          <td align="right">

<!--------------------------右边图标01----------------------------------->
		  <table border="0" cellpadding="0" cellspacing="0" id="ico1">
            <tr>
            <pms:AuthTag authName="customerService_custServEventAction.do?method=addCSEvent">
				<td class="toolbarico">
					<a href="#" onFocus="this.blur()" onClick="openCustomerEventAdd();">
						<img src="${ctx}/images/ico_newfile.gif" alt="事件登记" width="16" height="16" border="0" align="absbottom" />
					</a>
				</td>
				</pms:AuthTag>
				<pms:AuthTag authName="customerService_custServEventAction.do?method=editCSEvent">
              <td class="toolbarico"><a href="#"  onClick="openCustomerEventEdit();"onFocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" border="0" align="absbottom" alt="修改事件登记"/></a></td>
          </pms:AuthTag>
          <pms:AuthTag authName="customerService_custServEventAction.do?method=setAsideCustEvent">

    <td class="toolbarico"><a href="#" onClick="openAsideCustEvent();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="事件作废" width="16" height="16" border="0" align="absbottom" /></a></td>
       </pms:AuthTag>
            </tr>
          </table></td>
        </tr>
      </table></td>
    </tr>
    <tr>
    <td valign="top">
		<iframe  id="customerEventList"
			name="customerEventList" height="335px" frameborder="0" border="0"  width="100%"
			src="${ctx}/customerService_custServEventAction.do?method=initCustomerEventList" ></iframe>
      </td>
    </tr>
  </table>
</div>
<div id="quick_rightmenu" style="display:none;" oncontextmenu="return false" class="quick_menu2" onMouseOver="showmy2menu('quick_rightmenu')"  onMouseOut="hidden2menu('quick_rightmenu')" >
<iframe frameborder="0" style="position:absolute;top:0px;left:0px; width:100%; height:100%;z-index:-1 "></iframe>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="grid_quickMenu_bg">
        <tr>
      <td><table width="100%" border="0" cellpadding="2" cellspacing="0">
        <pms:AuthTag authName="customerService_custServEventAction.do?method=addCSEvent">
        <tr>
		  <td class="quickMenu_toolbarico">
		  	<a href="#"  onClick="openCustomerEventAdd();return false;"onFocus="this.blur()">
		  		<img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="事件登记"/> 事件登记
		  	</a>
		  </td>
        </tr>
        </pms:AuthTag>
        <pms:AuthTag authName="customerService_custServEventAction.do?method=editCSEvent">
        <tr>
		<td class="quickMenu_toolbarico">
			<a href="#"  onClick="openCustomerEventEdit();return false;"onFocus="this.blur()">
				<img src="${ctx}/images/ico_amend.gif" border="0" align="absbottom" alt="修改"/> 事件修改
			</a>
		</td>
        </tr>
       </pms:AuthTag>
      <pms:AuthTag authName="customerService_custServEventAction.do?method=setAsideCustEvent">
        <tr>
          <td class="quickMenu_toolbarico">
          	<a href="#" onClick="openAsideCustEvent();return false;" onFocus="this.blur()">
          		<img src="${ctx}/images/ico_delete.gif" alt="" width="16" height="16" border="0" align="absbottom" /> 事件作废
          	</a>
          </td>
        </tr>

		<tr>
		   <td class="hrpading"><table width="95%" border="0" align="left" cellpadding="0" cellspacing="0">
		     <tr><td class="quickMenu_line"></td></tr></table></td>
        </tr>
         </pms:AuthTag>
         <pms:AuthTag authName="customerService_deptCooperationAction.do?method=addTask">
		<tr>
             <td class="quickMenu_toolbarico">
	             <a href="#" onClick="openTaskSubmit();return false;" onFocus="this.blur()">
	             	<img src="${ctx}/images/ico_ok.gif" border="0" align="absbottom" alt="提 交"/>&nbsp;提 交
	             </a>
             </td>
        </tr>
        </pms:AuthTag>
        <pms:AuthTag authName="customerService_deptCooperationAction.do?method=initCustomerTaskMain">
	    <tr>
             <td class="quickMenu_toolbarico">
             	<a href="#" onClick="openCustomerEvent();return false;" onFocus="this.blur()">
             		<img src="${ctx}/images/ico_renwu.gif" border="0" align="absbottom" alt="任务列表"/>&nbsp;任务列表</a></td>
        </tr>
        </pms:AuthTag>
        <pms:AuthTag authName="customerService_dispatchFormAction.do?method=dispatchFormCommonMain">
	     <tr>
             <td class="quickMenu_toolbarico">
             	<a href="#"  onClick="openDispatchMain();return false;"onFocus="this.blur()">
             		<img src="${ctx}/images/ico_carryover.gif" border="0" align="absbottom" alt="事件分析"/>&nbsp;派工单管理
             	</a>
             </td>
        </tr>
        </pms:AuthTag>
        <pms:AuthTag authName="customerService_trackRecordAction.do?method=initMain">
       <tr>
      <td class="quickMenu_toolbarico">
      	<a href="#"  onClick="openTrackRecord();return false;"onFocus="this.blur()">
      		<img src="${ctx}/images/ico_sj_genzong.gif" alt="" width="16" height="16" border="0" align="absbottom" /> 事件跟踪
      	</a>
      </td>
      </tr>
      </pms:AuthTag>
      <pms:AuthTag authName="customerService_custServEventAction.do?method=manualTriggerComplete">
       <tr>
      <td class="quickMenu_toolbarico">
      	<a href="#"  onClick="openOver();return false;" onFocus="this.blur()">
      		<img src="${ctx}/images/ico_pass.gif" alt="事件完工" width="15" height="16" border="0" align="absbottom"/> 事件完工
      	</a>
      </td>
    </tr>
    </pms:AuthTag>
    <pms:AuthTag authName="customerService_returnVisitAction.do?method=initMain">
        <tr>
          <td class="quickMenu_toolbarico">
          	<a href="#"  onclick="openReturnVisitRecord();return false;"onfocus="this.blur()">
          		<img src="${ctx}/images/ico_house_fwxs.gif" alt="" width="16" height="16" border="0" align="absbottom" /> 回访管理
          	</a>
          </td>
    </tr>
    </pms:AuthTag>
    <pms:AuthTag authName="customerService_custServEventAction.do?method=archivism">
	<tr>
          <td class="quickMenu_toolbarico">
          	<a href="#" onClick="openArchivism();return false;" onFocus="this.blur()">
          		<img src="${ctx}/images/ico_principal_rwcl.gif" alt="" width="16" height="16" border="0" align="absbottom" /> 归 档
          	</a>
          </td>
   </tr>
   </pms:AuthTag>
   <pms:AuthTag authName="customerService_CheckRecordAction.do?method=initMain">
   <tr>
          <td class="quickMenu_toolbarico">
          	<a href="#"  onclick="openCheckRecord();return false;"onfocus="this.blur()">
          		<img src="${ctx}/images/ico_house_fwxs.gif" alt="" width="16" height="16" border="0" align="absbottom" /> 抽检登记
          	</a>
          </td>
    </tr>
    </pms:AuthTag>
    <pms:AuthTag authName="customerService_signReadingAction.do?method=noteAddSignReading">
    <tr>
     <td class="toolbarico">
     	<a href="#"  onClick="openSignReading();return false;"onFocus="this.blur()">
     		<img src="${ctx}/images/ico_huifang.gif" border="0" align="absbottom"/>&nbsp;阅 签
     	</a>
     </td>
	</tr>
	</pms:AuthTag>
	<pms:AuthTag authName="customerService_custServEventAction.do?method=initLinkTheOtherListMain">
   <tr>
       <td class="quickMenu_toolbarico">
       	<a href="#"  onclick="openLinkTheOther();return false;"onfocus="this.blur()">
       		<img src="${ctx}/images/ico_yhhk_gh.gif" alt="关联事件" width="16" height="16" border="0" align="absbottom"/>&nbsp;关联事件
       	</a>
        </td>
    </tr>
    </pms:AuthTag>
  </table></td>
    </tr>
  </table>
 <script type="text/javascript">

	var div1=document.getElementById('quick_rightmenu');
	if(div1.getElementsByTagName("tr").length==1){
	div1.innerHTML="";
	}
</script>
</div>
</body>
</html>
